<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="/assets/js/maps.js"></script>
<script type="text/javascript">
<!--
$(function(){
	$("#nav-lost").addClass("now");
	$("#post").tabs();
});

function initmap(div) {
	var mapOptions = {
		zoom: 16,
		center: tkk,
		mapTypeControl: false,
		mapTypeId: google.maps.MapTypeId.SATELLITE
	};
	
	map = new google.maps.Map(document.getElementById(div), mapOptions);
	
	addMarks(mapdatas);
	
	google.maps.event.addListener(map, 'click', hideInfo);
}

window.onload = function(){
	initmap("items_map_canvas");
}
-->
</script>
<div class="contentLeft">
	<?php if(!is_null($view['type'])){?>
	<div id="post">
		<ul><li><a href="#tabs-1">快速提交</a></li></ul>
		<div id="tabs-1">
			<form action="/post/quick" method="post">
				<input type="hidden" name="type" value="<?php echo $view['type']?'found':'lost'?>" />
				<label for="what">物品名称：</label><input type="text" name="what" id="what" />
				<input type="submit" id="submitbtn" value="<?php echo $view['type']?'发布招领信息':'发布寻物信息'?>"/>
			</form>
		</div>
	</div>
	<?php }?>
</div>
<div class="contentLeft">
	<div id="listbox">
		<h3><?php echo $view['type']?'招领启事':'寻物启事'?></h3>
		<?php
		if($view['items']->valid()){ 
		?>
		<table id="itemlist">
		<thead>
			<tr><th class="what">物品</th>
				<th class="detail">描述</th>
				<th class="postscrite">备注</th>
				<th class="posttime">提交时间</th>
			</tr>
		</thead>
		<tbody>
		<?php
		foreach($view['items'] as $item){
			echo view::show('items/item', array('item'=>$item));
		}?>
		</tbody>
		</table>
		<div id="pagenav"><?php
		$pagenav = $view['pagenav'];
		$current = $pagenav['current'];
		$pages = $pagenav['pages'];
		if(1 < $current) echo "<a href='#'>上一页</a>";
		for($i=1; $i<=$pages; $i++){
			if($i==$current)
				echo "<a href='#' class='current'>$i</a>";
			else
				echo "<a href='#'>$i</a>";
		}
		if($current < $pages) echo "<a href='#'>下一页</a>"; 
		?></div>
		<?php }else{?>
		<div>没有物品信息 :(</div>
		<?php }?>
	</div>
</div>
<div class="contentRight"> 
	<h3>地图</h3> 
	<div id="items_map_canvas"></div>
</div> 